﻿Shader "Custom/LensFlare" {
	Properties {
		_LightPower ("LightPower", float) = 1
        _TintColor ("TintColor", Color) = (1,1,1,1)
	}
	SubShader {
		Tags { "Queue"="Transparent" 
				"IgnoreProjector"="True"
				"RenderType"="Transparent" }
		Pass {
			Name "BASE"
			LOD 200
            Blend One One
			Zwrite Off
			CGPROGRAM
			
			#pragma vertex vert 
	        #pragma fragment frag
	        #include "UnityCG.cginc"

			struct VertIn {
	        	float4 vertex : POSITION;
	        	float4 color : COLOR;
	        };
	        struct v2f {
	        	float4 pos : SV_POSITION;
	        	float4 colour : TEXCOORD1;
	        };
	        
	        uniform sampler2D _MainTex;
			uniform fixed _LightPower; 
			uniform fixed4 _TintColor;
			 
	        
	        v2f vert(VertIn v) 
			{
				v2f o;
				o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
				o.colour = v.color;
				return o;
			}
			
			fixed4 frag(v2f i) : Color {
				return i.colour * _LightPower * _TintColor;
			}
	        ENDCG
		}
	
	} 
	FallBack "Diffuse"
}
